package com.cg.controller;

import com.cg.dto.Result;
import com.cg.dto.ResultUtils;
import com.cg.entity.Country;
import com.cg.service.CountryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Country)表控制层
 *
 * @author chengong
 * @since 2024-01-03 16:54:45
 */
@RestController
@RequestMapping("/country")
public class CountryController {
    /**
     * 服务对象
     */
    @Resource
    private CountryService countryService;

    /**
     * 加载所有国家
     */
    @GetMapping("/queryCountryList")
    public Result<List<Country>> queryCountryList(){
        return ResultUtils.returnDataSuccess(countryService.queryCountryList());
    }

}

